from django.conf.urls.defaults import *
from vimMain.models import VMHOST
from vimMain.views import *

info_dict_1 = {
    'queryset': VMHOST.objects.all(),
    'template_name': 'vmhost_list.html',
}

info_dict_2 = {
    'queryset': VMHOST.objects.all(),
    'template_name': 'vmhost_detail.html',
}

urlpatterns = patterns('django.views.generic.list_detail',
    (r'^ovim/$', VMHostList),
    (r'^ovim/(?P<VMHost_id>\d+)/listvms/$', VMList),
    (r'^ovim/(?P<VMHost_id>\d+)/listvms/(?P<VM_id>\d+)/$', VMEdit),
    (r'^ovim/(?P<VMHost_id>\d+)/listvms/(?P<VM_id>\d+)/recover/$', VMRecover),
    (r'^ovim/(?P<VMHost_id>\d+)/listvms/(?P<VM_id>\d+)/delete/$', VMDelete),
    (r'^ovim/(?P<VMHost_id>\d+)/listvms/addvm/$', VMAdd),
    (r'^ovim/addvmhost/$', VMHostAdd), 
    (r'^ovim/(?P<object_id>\d+)/$', VMHostEdit),
    (r'^ovim/(?P<object_id>\d+)/delete/$', VMHostDelete),
    (r'^ovim/listjp/$', JPList),
    (r'^ovim/listjp/(?P<jp_id>\d+)/monitor/$', JPMonitor),
    (r'^ovim/listjp/(?P<jp_id>\d+)/delete/$', JPDelete),    
    (r'^ovim/listjp/(?P<jp_id>\d+)/startnow/$', RestartJP),
    (r'^ovim/listjp/(?P<jp_id>\d+)/edit/$', JPEdit),
    (r'^ovim/listjp/new/$', JPAdd),
    (r'^ovim/monitjb/$', JBMonitor),    
    (r'^ovim/logview/$', Logview_core),
    (r'^ovim/logview/jobid=(?P<job_id>\d+)/$', Logview_by_jobid),
    
    (r'^ovim/setup/$', OVIMSetup),
    
#    (r'^ovim/(?P<object_id>\d+)/$', 'object_detail', info_dict_2),
)

urlpatterns += patterns('',
    #(r'^ovim/media/(?P<path>.*)', 'django.views.static.serve', {'document_root': '/home/vni/Devel/Project/OVIM/src/OVIM/vimMain/media/'}),    
    (r'^ovim/media/(?P<path>.*)', 'django.views.static.serve', {'document_root': '/Users/vni/Documents/Devel/Projects/OVIM/src/OVIM/vimMain/media/'}),    
    (r'^admin/', include('django.contrib.admin.urls')),
)
